﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;

namespace ACP.Data
{
    public interface IRepository<T> : IDisposable where T : class
    {
        IQueryable<T> AsQueryable();
        IEnumerable<T> GetAll();
        IEnumerable<T> Find(Expression<Func<T, bool>> where);
        IEnumerable<T> GetAllOrderBy(Expression<Func<T, bool>> orderBy);
        IEnumerable<T> GetAllOrderByDescending(Expression<Func<T, bool>> orderByDescending);
        IEnumerable<T> GetAllWithIncludes(string[] includes);

        T Single(Expression<Func<T, bool>> where);
        T First(Expression<Func<T, bool>> where);

        void Delete(T entity);
        void Add(T entity);
        void AddObjects(ICollection<T> listEntities);
        void Update(T entity);
       // void Attach(T entity);
        //T Create(T TObject);
        //int DeleteObject(T TObject);
        //int Update(T TObject);
    }
}
